﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Arith
{
    public class Param
    {
        public static void Main()
        {
            MyArith ma = new MyArith();

            double d1 = ma.Average(10, 5, 13, 34,41,1);
            double d2 = ma.Average(10, 5);
            Console.WriteLine("Average is " + d1);
            Console.WriteLine("Average is " + d2);
            Console.Read();
        }
    }
    class MyArith
    {
        public double Average(params int[] values)
        {
            int s = 0;
            foreach (var n in values)
            {
                s = s + n;
            }
            double avg = (double)s / values.Length;
            return avg;
        }
    }
}
